//
//  BusinessDealsController.m
//  欢乐美食
//
//  Created by 遇水 on 15/6/24.
//  Copyright (c) 2015年 遇水. All rights reserved.
//

#import "BusinessDealsController.h"
#import "BusinessDealsViewCell.h"
#import "SingerDealController.h"

#import "MSDealTool.h"

#define  collectionCellID @"cell"

//此界面的设置
@interface BusinessDealsController ()<UICollectionViewDelegate,UICollectionViewDataSource>

@property (nonatomic, strong) UICollectionView    *collectionView;

@end

@implementation BusinessDealsController

- (void)viewDidLoad {
    [super viewDidLoad];
   

}

-(void)newWorking{
    
    FindBusnissSingleParam *param = [[FindBusnissSingleParam alloc]init];
    param.business_id = self.businessID;
    [MSDealTool findBusnissSingle:param success:^(FindBusnissSingleResult *result) {
        
        [self.collectionView reloadData];
    } failure:^(NSError *error) {
        
    }];
}





-(void)initCollectionView
{
    UICollectionView *collection = [[UICollectionView alloc]init];
//    
//    [collection registerNib:@"BusinessDealsViewCell" forCellWithReuseIdentifier:collectionCellID];
    [collection registerClass:[BusinessDealsViewCell class] forCellWithReuseIdentifier:collectionCellID];
    collection.dataSource = self;
    collection.delegate = self;
    [self.view addSubview:collection];
    self.collectionView = collection;
    
}
#pragma mark - collectionDelegate
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
    return 2;
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 0;
}


//-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
//{
//    
//}


//选中的时候的信息
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    SingerDealController *singerDeal = [[SingerDealController alloc]init];
//    singerDeal.dealID = ;
    [self.navigationController pushViewController:singerDeal animated:YES];
    
}







@end
